- sh ./.travis.install.deps.sh
script:
+ - ./configure --local-rust-root=`pwd`/rustc
- make
- - make test -j4
- - make install DESTDIR=${PWD}/destdir
+ - make test
+ - make distcheck
env:
- BITS=32
endef
$(foreach target,$(CFG_TARGET),$(eval $(call DIST_TARGET,$(target))))
-CARGO := $(TARGET_ROOT)/snapshot/cargo-nightly/bin/cargo$(X)
+CARGO := $(TARGET_ROOT)/snapshot/bin/cargo$(X)
all: $(foreach target,$(CFG_TARGET),cargo-$(target))
$(foreach target,$(CFG_TARGET),$(eval $(call CARGO_TARGET,$(target))))
$(CARGO): src/snapshots.txt
- $(CFG_PYTHON) src/etc/dl-snapshot.py
+ $(CFG_PYTHON) src/etc/dl-snapshot.py $(CFG_BUILD)
touch $@
fn execute(_: Options, _: &mut MultiShell) -> CliResult<Option<()>> {
debug!("executing; cmd=cargo-version; args={}", os::args());
- println!("cargo {}", env!("CFG_VERSION"));
+ println!("{}", cargo::version());
Ok(None)
}
}
pub fn version() -> String {
- (env!("CFG_VERSION")).to_string()
+ format!("cargo {}", env!("CFG_VERSION"))
}
fn flags_from_args<T: FlagParser>(args: &[String],
import subprocess
import sys
import tarfile
+import shutil
f = open('src/snapshots.txt')
lines = f.readlines()
date = lines[0]
-mac = lines[1]
-linux = lines[2]
-win = lines[3]
-
-if 'linux' in sys.platform:
- me = linux
-elif sys.platform == 'win32':
- me = win
-elif sys.platform == 'darwin':
- me = mac
+linux32 = lines[1]
+linux64 = lines[2]
+mac32 = lines[3]
+mac64 = lines[4]
+win32 = lines[5]
+triple = sys.argv[1]
+
+if triple == 'i686-unknown-linux-gnu':
+ me = linux32
+elif triple == 'x86_64-unknown-linux-gnu':
+ me = linux64
+elif triple == 'i686-apple-darwin':
+ me = mac32
+elif triple == 'x86_64-apple-darwin':
+ me = mac64
+elif triple == 'i686-pc-mingw32':
+ me = win32
else:
- raise Exception("no snapshot for the platform: " + sys.platform)
+ raise Exception("no snapshot for the triple: " + triple)
platform, hash = me.strip().split(' ')
-tarball = 'cargo-nightly-' + platform + '.tar.gz'
+tarball = 'cargo-nightly-' + triple + '.tar.gz'
url = 'http://static.rust-lang.org/cargo-dist/' + date.strip() + '/' + tarball
dl_path = "target/dl/" + tarball
dst = "target/snapshot"
if not os.path.isdir('target/dl'):
os.makedirs('target/dl')
+if os.path.isdir(dst):
+ shutil.rmtree(dst)
+
ret = subprocess.call(["curl", "-o", dl_path, url])
if ret != 0:
raise Exception("failed to fetch url")
tar = tarfile.open(dl_path)
for p in tar.getnames():
- name = p.replace("cargo-nightly/", "", 1)
+ name = p.replace("cargo-nightly-" + triple + "/", "", 1)
fp = os.path.join(dst, name)
print("extracting " + p)
tar.extract(p, dst)
+ shutil.move(os.path.join(dst, p), fp)
tar.close()
+shutil.rmtree(os.path.join(dst, 'cargo-nightly-' + triple))
if not os.path.isdir('target/dl'):
os.makedirs('target/dl')
-snaps = ['mac', 'linux', 'win']
-for snap in snaps:
- tarball = 'cargo-nightly-' + snap + '.tar.gz'
+snaps = {
+ 'macos-i386': 'i686-apple-darwin',
+ 'macos-x86_64': 'x86_64-apple-darwin',
+ 'linux-i386': 'i686-unknown-linux-gnu',
+ 'linux-x86_64': 'x86_64-unknown-linux-gnu',
+ 'winnt-i386': 'i686-pc-mingw32',
+}
+
+for platform in sorted(snaps):
+ triple = snaps[platform]
+ tarball = 'cargo-nightly-' + triple + '.tar.gz'
url = 'http://static.rust-lang.org/cargo-dist/' + date + '/' + tarball
dl_path = "target/dl/" + tarball
ret = subprocess.call(["curl", "-s", "-o", dl_path, url])
if ret != 0:
raise Exception("failed to fetch url")
h = hashlib.sha1(open(dl_path, 'rb').read()).hexdigest()
- print(' ' + snap + ' ' + h)
+ print(' ' + platform + ' ' + h)
+2014-07-30
+ linux-i386 4d4e78426060b891cf729d5e3cca86d5aebdd31d
+ linux-x86_64 2a39bb838bc1c740d41a2ee8054a2c32f1efbec8
+ macos-i386 16d1581dad71b1cf551646bc2dfdc920f4dda16c
+ macos-x86_64 05d836f2195e55f050e68e8bb209405a67fbefcb
+ winnt-i386 ade95f921ba73848d2ae67d1b8cd7c364e881e86
+
2014-07-29
mac 53f8bc39132e987d25e022698c3234fee0916ecf
linux b7dbdc89126577fda2eef7d63c5f7fc1d8d28f99